package com.simtop.mapper;

import com.simtop.domain.simtopnews.News;
import com.simtop.domain.simtopnews.NewsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author lvyongwei
 */
@Mapper
public interface NewsMapper {

    /**
     * 添加新闻
     * @param news
     * @return
     */
    public boolean insertNews(News news);

    /**
     * 获取新闻列表
     * @param news
     * @return
     */
    public List<NewsVo> getAllNews(News news);

    /**
     * 修改新闻
     * @param news
     * @return
     */
    public boolean updateNews(News news);

    /**
     * 批量删除
     * @param ids
     * @return
     */
    public boolean deleteNews(@Param("list")List<Long> ids);

    /**
     * 根据id获取新闻详情
     * @param newsId
     * @return
     */
    public News getNewsById(Long newsId);
}
